package chapter06

object Test14_TraitMixin {
  def main(args: Array[String]): Unit = {


    //动态混入,不在 声明实现，而在实例化的时候进行实现
//    var s = new Student14 with Talent{
//      override def singing(): Unit = {
//
//      }
//
//      override def dancing(): Unit = {
//
//      }
//    }
//    s.sayHello()
//    s.dancing()
  }
}

// 再定义一个特征
trait Knowledge{

  var amount :Int = 0
  def increase():Unit={
    println(23)
  }

}

trait Talent {
  def singing():Unit
  def dancing():Unit
  def increase():Unit ={
    println(123)
  }
}

class Student14 extends Person13
with Young with Knowledge{

  override val name: String = "override"
  override val age: Int = 123

  override def dating(): Unit = ???

  override def increase(): Unit = {
    super.increase()
  }
}
